CREATE TABLE taxonomy AS SELECT prot_hit.sequence,coverage.length,coverage.reads,coverage.coverage,prot_domain.prot_domain,prot_phylum.prot_phylum,prot_class.prot_class,prot_order.prot_order,prot_family.prot_family,prot_genus.prot_genus,prot_species.prot_species,nucl_domain.nucl_domain,nucl_phylum.nucl_phylum,nucl_class.nucl_class,nucl_order.nucl_order,nucl_family.nucl_family,nucl_genus.nucl_genus,nucl_species.nucl_species,ip2gopath.ip2go,eggnogpath.eggnog,prot_hit.prot_hit,prot_hit.prot_Evalue,nucl_hit.nucl_hit,nucl_hit.nucl_Evalue 
FROM prot_hit

LEFT JOIN coverage ON coverage.sequence=prot_hit.sequence
LEFT JOIN prot_domain ON prot_domain.sequence = prot_hit.sequence
LEFT JOIN prot_phylum ON prot_phylum.sequence = prot_hit.sequence
LEFT JOIN prot_class ON prot_class.sequence = prot_hit.sequence
LEFT JOIN prot_order ON prot_order.sequence = prot_hit.sequence
LEFT JOIN prot_family ON prot_family.sequence = prot_hit.sequence
LEFT JOIN prot_genus ON prot_genus.sequence = prot_hit.sequence
LEFT JOIN prot_species ON prot_species.sequence = prot_hit.sequence

LEFT JOIN nucl_domain ON nucl_domain.sequence = prot_hit.sequence
LEFT JOIN nucl_phylum ON nucl_phylum.sequence = prot_hit.sequence
LEFT JOIN nucl_class ON nucl_class.sequence = prot_hit.sequence
LEFT JOIN nucl_order ON nucl_order.sequence = prot_hit.sequence
LEFT JOIN nucl_family ON nucl_family.sequence = prot_hit.sequence
LEFT JOIN nucl_genus ON nucl_genus.sequence = prot_hit.sequence
LEFT JOIN nucl_species ON nucl_species.sequence = prot_hit.sequence

LEFT JOIN ip2gopath ON ip2gopath.sequence = prot_hit.sequence
LEFT JOIN eggnogpath ON eggnogpath.sequence = prot_hit.sequence

LEFT JOIN nucl_hit ON nucl_hit.sequence = prot_hit.sequence;

ALTER TABLE taxonomy ADD COLUMN final_domain TEXT;
ALTER TABLE taxonomy ADD COLUMN final_phylum TEXT;
ALTER TABLE taxonomy ADD COLUMN final_class TEXT;
ALTER TABLE taxonomy ADD COLUMN final_order TEXT;
ALTER TABLE taxonomy ADD COLUMN final_family TEXT;
ALTER TABLE taxonomy ADD COLUMN final_genus TEXT;
ALTER TABLE taxonomy ADD COLUMN final_species TEXT;
ALTER TABLE taxonomy ADD COLUMN state_taxo TEXT; 
ALTER TABLE taxonomy ADD COLUMN rna_type TEXT;
ALTER TABLE taxonomy ADD COLUMN state_function TEXT;
ALTER TABLE taxonomy ADD COLUMN function_type TEXT
